#ifndef _BASE_WRITER_H_
#define _BASE_WRITER_H_

#include <memory>

class wxXmlDocument;
class wxXmlNode;

class BaseWriter
{
public:
  BaseWriter();
  virtual ~BaseWriter();

  void BeginDocument(const wxString& name);
  void BeginSection(const wxString& name);
  void EndSection();

  void Add(const wxString& name, const wxString& value);
  void Add(const wxString& name, int value);

  wxXmlNode* GetCurrent();

  bool Save(const wxString& filename, int indentstep = 1) const;
private:
  std::auto_ptr<wxXmlDocument> Data;
  wxXmlNode* Current;
};

#endif // _BASE_WRITER_H_
